Common problem
SSL certificate
If you have just configured the CDN and find that your site cannot be opened securely, you need to configure the SSL certificate on our platform. The operation is as follows:
Click the CDN resource to find the resource and enter the details.
Click Basic Settings. There is an SSL module below.
Edit and select the SSL certificate type. You can select the free certificate of Let's Encrypt or the customized SSL certificate(Custom SNI SSL).
It may take 5-10 minutes for the SSL certificate to take effect, and then the website can log in normally.
How to troubleshoot low CDN hit rate
Problem Explanation
In the data panel Requests, you can see the proportion of hit rates. Generally, a hit rate above 90% is a normal value, indicating that your business is effectively cached through LightCDN. If there is a situation where the cache is below 90%, it is not entirely a business failure. You can troubleshoot according to the following plan.
Solution
Confirm the performance of the source station
You can test the response time of the origin site. If the response time of the origin site is long, it will also affect the hit rate of CDN. If there are no issues, proceed to the next step of inspection.First, confirm your own source configuration
(1) Expiration period. The cache time is too low and the frequency of returning to the source is high. This operation will reduce the hit rate.
(2) Rules. The caching strategy can also affect the hit rate of CDN. You can check if your rule set contains a large amount of uncached content. If there is no reasonable caching strategy set, it will reduce the hit rate and also result in poor delivery performance of CDN.The following are some possible reasons why CDN URL may not be able to cache, corresponding to whether to enable settings. Please disable some unnecessary settings to improve caching rate:
(1) Origin Cache-Control has set no-cache: ensuring that the native Cache-Control header is not set to no cache.
(2) Cookies are enabled: You may need to configure "Ignore Set-Cookie" in CDN Resources → Advanced Settings.
(3) Expiry header comes before Cache-Control header: LightCDN will honor the order of web headers. If the Expiry header is set to an old date, the content will never be cached.
(4) 301/302 redirect: If you receive a 301/302 redirect when executing "curl-I" on a CDN URL, you may need to remove the redirect from the web source or use an IP source (if the redirect rules do not apply to the IP).Confirm if there are any error codes
Check the error code and data to confirm the frequency of recent error codes. If the frequency of error codes is high, you can first debug the code to confirm if it is an error that exists on the source site. If it is confirmed to be correct, it may be the following error:
(1) Error caused by same origin request, 'No access control allow origin header is presented on the requested resource.'. This may result in a large number of 500 errors. For specific solutions, please refer to the next article 'Error caused by same origin requests with 500 status codes'.
(2) The black and white lists for IP/region/URL(IP access/Country access/Hotlink policy) have been activated, but the actual access does not comply with the rules, resulting in 403. You can confirm the configuration in security. If it does not match the actual business situation, please optimize the settings.
If none of the above situations are met, you can send an email support@lightcdn.com Or contact our online customer service for assistance in troubleshooting.Check if the request volume/traffic has significantly increased in traffic.
When the traffic volume is very high, the transmission speed of CDN may be affected. You can check the transmission speed in Traffic → Visitor Analysis and optimize it.
[500 status code] Error caused by same origin request
Problem Explanation
Web browsers do not permit fonts to be loaded from a different domain unless CORS headers are setup to allow it.
This problem can be seen in the browser console:
Font from origin 'http://cdn.example.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.example.com' is therefore not allowed access.
Solution
Instructions to enable permissive CORS headers for fonts:
1.Add to your webserver config:
Apache
<FilesMatch "\.(eot|otf|ttf|woff|svg)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
Nginx
location ~* \.(eot|otf|ttf|woff|svg)$ {
add_header Access-Control-Allow-Origin *;
}
2.Verify that the headers are returned by the origin server as expected.
3.Purge the fonts from the CDN so that the headers are refreshed.
Additionally, please note that for push resources, you need to add them through the caching rules in Resource → Rules.
How to solve the problem of excessive redirection prompts when accessing the origin through CDN?
Problem Explanation
When you access a CDN hostname that has already been configured with LightCDN, the site displays an error message "ERR_TOO_MANY_REDIRECTS". This situation means that your configuration has encountered a loop error, resulting in the inability to access the origin site address with content properly. Normally, it is normal for you to visit again after the first visit or purging, but the above error may still occur after a period of time.
You can further confirm the situation issue. On the Status Code page, you can see that Status 3xx (301, 302, etc.) is appearing, which means that the redirection layer is being set up (on the origin site/web server). You can also obtain the header information of the HTTP response through the "curl-I" command, and the data will be displayed as follows:
HTTP/1.1 301 Moved Permanently
All information will point to the status code Status 3xx (301, 302, etc.).
Solution
For example, when you create a resource on LightCDN and access the CDN hostname, it appears as "ERR_TOO-MANY-REDUCTS".
Origin:www.example.com
CDN hostname:cdn.example.com
- You need to first check if the CDN configuration is appropriate to avoid loop redirection when returning to the origin.Please note that if your origin has enabled HTTPS access, you need to ensure that the origin policy is also the same. You can view Resource Details → Advanced Settings → Origin Policy and select HTTPS.
- Confirm if there are any conflicts in the redirection strategy of the origin itself. For example, if you set "www.example. com" on the source site to redirect to "cdn.example.com", this setting is opposite to the CDN setting, causing the loop to also report this error. You can check if there is a rewrite command in the origin code.
The above operation requires to purge the cache to check if normal access has been restored. If the error persists after confirming the above operation, please contact customer service or send an email to support@lightcdn.com.